package cn.chenwx.bbsforum.entity;

import cn.chenwx.bbsforum.utils.DateUtils;
import lombok.Data;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Data
public class User {

    private Integer id;
    private String username;
    private String password;
    // 0表示女，1表示男
    private Integer sex;
    private String email;
    private String phone;
    private Date creatTime;
    private String creatTimeStr;
    private String avatarImgUrl;

    public String getCreatTimeStr() {
        return creatTimeStr;
    }

    public void setCreatTimeStr(String creatTimeStr) {
        if (creatTime!=null){
            creatTimeStr= DateUtils.dateToString(creatTime,"yyyy-MM-dd HH:mm");
        }
        this.creatTimeStr = creatTimeStr;
    }

    private Date modifyTime;
    private String role;
    private Integer status;
    private String sexStr;

}
